<template>
  <h1>欢迎来到登录页面</h1>
  <button @click="doLogin()">登录</button>
  <button @click="doGet()">get请求</button>
</template>
<script setup>
import { useRouter } from "vue-router";
import axios from "axios";
const router = useRouter();
const doLogin = () => {
  alert("登录成功！");
  router.push({ name: "user", params: { id: 4 } });
};

const doGet = () => {
 axios.get('http://43.139.239.29/get').then(resp=>{
    alert(resp.data.data);
 })
};
</script>